<ion-view view-title={{moduleTitle}} cache-view="false">
	<ion-nav-buttons side="left">
		<a class="button button-icon ion-arrow-left-c" ng-click="goBack()"></a>
	</ion-nav-buttons>
	<div class="tabs-striped tabs-top">
		<div class="tabs">
			<a ng-if="access.list" ng-class="{'tab-item':true,'active': id }" href="#/{{moduleName}}/list">查看</a>
			<a ng-if="access.add" ng-class="{'tab-item':true,'active': !id }" href="#/{{moduleName}}/0">添加</a>
		</div>
	</div>
	<ion-content class="padding has-tabs-top">
		<form name="detailForm" novalidate="" ng-submit="submitForm(detailForm)">
			<div class="list">
				<insert-address  form="detailForm"  addressoption="addressOption"></insert-address>
				
				<label class="item item-input">
					<span class="input-label">详细地址<span style="color: red;">*</span>:</span>
					<input type="text" name="addr_details" ng-model="detail.addr_details" ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }"
							ng-maxlength="50">
				</label>

				<div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
					 ng-messages="detailForm.addr_details.$error" role="alert">
					<div ng-messages-include="templates/system-templates/detail-maxlength-50.html"></div>
				</div>

				<label class="item item-input">
					<span class="input-label">基层商姓名<span style="color: red;">*</span>:</span>
					<input type="text" name="name" ng-model="detail.name" ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }"
							required>
				</label>

				<div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
					 ng-messages="detailForm.name.$error" role="alert">
					<div ng-messages-include="templates/system-templates/detail-maxlength-20.html"></div>
				</div>
				<label class="item item-input">
					<span class="input-label">电话<span style="color: red;">*</span>:</span>
					<input type="text" name="phone" ng-model="detail.phone" ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }"
							required
						   ng-pattern="/^((13[0-9])|147|(15[0-35-9])|180|182|(18[5-9]))[0-9]{8}$/">
				</label>
				<!--Error Container for Password -->
				<div class="validation-error" ng-class="{'is-dirty':detailForm.cell.$dirty}"
					 ng-messages="detailForm.phone.$error" role="alert">
					<div ng-messages-include="templates/system-templates/detail-cell-error.html"></div>
				</div>
				<!--化肥品种-->
				<insert-select form="detailForm" option="sacfvarietyOption"></insert-select>
				<!---->
				<label class="item item-input">
					<span class="input-label">门头长度(米):</span>
					<input type="text" name="width" ng-model="detail.width" ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }"
						   ng-pattern='/^\d{1,6}([\.]\d{0,2})?$/'>
				</label>
				<!-- Error Container for Password -->
				<div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
					 ng-messages="detailForm.width.$error" role="alert">
					<div ng-messages-include="templates/system-templates/detail-errors.html"></div>
				</div>
				<label class="item item-input">
					<span class="input-label">门头高度(米):</span>
					<input type="text" name="height" ng-model="detail.height" ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }"
						   ng-pattern='/^\d{1,6}([\.]\d{0,2})?$/'>
				</label>
				<!-- Error Container for Password -->
				<div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
					 ng-messages="detailForm.height.$error" role="alert">
					<div ng-messages-include="templates/system-templates/detail-errors.html"></div>
				</div>
				<insert-select form="detailForm" option="brandOption"></insert-select>
				<!--作物-->
				<insert-select form="detailForm" option="plantOption"></insert-select>
				<!---->
				<label class="item item-input">
					<span class="input-label">种植面积(亩)<span style="color: red;">*</span>:</span>
					<input type="text" name="farm_area" ng-model="detail.farm_area" ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }"
							required
						   ng-pattern='/^\d{1,8}([\.]\d{0,2})?$/'>
				</label>
				<!-- Error Container for Password -->
				<div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
					 ng-messages="detailForm.farm_area.$error" role="alert">
					<div ng-messages-include="templates/system-templates/detail-errors.html"></div>
				</div>
				<!--<label class="item item-input">-->
					<!--<span class="input-label">今年销量<span style="color: red;">*</span>:</span>-->
					<!--<input type="text" name="sales_1" ng-model="detail.sales_1" ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }"-->
							<!--required-->
						   <!--ng-pattern='/^\d{1,8}([\.]\d{0,2})?$/'>-->
				<!--</label>-->
				<!--&lt;!&ndash; Error Container for Password &ndash;&gt;-->
				<!--<div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"-->
					 <!--ng-messages="detailForm.sales_1.$error" role="alert">-->
					<!--<div ng-messages-include="templates/system-templates/detail-errors.html"></div>-->
				<!--</div>-->

			</div>
			<button class="button button-full button-positive" ng-disabled="detailForm.$invalid || detailEdit.editDisabled" type="submit">
				{{operation}}
			</button>
		</form>
	</ion-content>
	<!--头部和内容结束-->
</ion-view>